<div class="container">
<div style="max-width:600px;margin:0 auto;">
<style>
body{
	overflow-x:hidden;
}
</style>
<h2><span class="title">意见反馈</span></h2>
<hr>
{{$this->Form->create('FeedBack',array('class'=>'form-horizontal','role'=>'form'))}}
<small>
<p>如果你有其它的功能需求，或者在使用过程中有什么操作感觉不顺手，欢迎给我们提交反馈意见。</p>
<p>我们会根据您的意见不断的改进优化产品，为您提供更优质的服务，谢谢您的反馈。</p>
</small>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="FeedBackName">您的意见<span style="color:red;">*</span></label>
		<div class="col-sm-12 controls">
			{{$this->Form->input('name',array('class'=>'form-control','required'=>'required','rows'=>3,'div'=>false,'label'=>false))}}
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label" for="WxMsgCoverimg">附件图片</label>
		<div class="col-sm-10 controls select" style="position: relative;padding-right: 200px;">

			{{$this->Swfupload->load('files',array(
			'label'=>false,'modelClass'=>'FeedBack',
			'isadmin' => false,'split'=>false,
			'input_type' => 'hidden',
			'file_types'=> '*.jpg;*.gif;*.png;*.bmp',
			'isadmin'=>false
			))}}
		</div>
	</div>
	<?php if(!defined('IS_MOBILE') ) {?> 
	<p><a class="btn btn-warning" href="javascript:show135Editor();">外部调用135编辑器体验</a><small>（也许你公司的内部系统需要这种方式）</small></p>
	<p><small>请输入您的联系方式，便于我们与您取得联系，您可能收到我们的邮件回复。</small></p>
	<?php } ?>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="FeedBackEmail">邮箱</label>
		<div class="col-sm-10">
			{{$this->Form->input('email',array('type'=>'email','class'=>'form-control','div'=>false,'label'=>false,))}}
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label" for="FeedBackQQ">QQ</label>
		<div class="col-sm-10">
			{{$this->Form->input('qq',array('class'=>'form-control','div'=>false,'label'=>false,))}}
		</div>
	</div>
	<!-- 没时间打电话，而且电话描述不清问题。还是邮件或QQ截图更容易说明问题，更有效沟通。<div class="form-group">
		<label class="col-sm-2 control-label" for="FeedBackPhone">电话</label>
		<div class="col-sm-10">
			{{$this->Form->input('phone',array('type'=>'text','class'=>'form-control','div'=>false,'label'=>false,))}}
		</div>
	</div> -->
	
	<div class="form-group">
		<div class="col-sm-12"><input class="btn btn-primary" style="width:100%;display:block;" type="submit" value="提交"></div>
	</div>
{{$this->Form->end()}}

<?php if(!defined('IS_MOBILE') ) {?> 

{{$this->Html->script(array(
	'ckeditor/ckeditor.js',
))}}

<script>
$(function(){
	CKEDITOR.editorConfig = function( config ){
		config.toolbar = 'FRONT';
	}
	ckeditors['FeedBackName'] = CKEDITOR.replace( 'FeedBackName',
		    {
		        customConfig : '{{$this->Html->url("/js/ckeditor/front-config.js")}}'
		    });
	ckeditors['FeedBackName'].on('focus',function(e){
		current_ckeditor_instance = e.editor;
	});
	

	CKEDITOR.on( 'instanceReady', function( e ){
		e.editor.document.appendStyleSheet( '{{$this->Html->url("/stylevars/getcss.css")}}' );
		e.editor.document.appendStyleSheet( '{{$this->Html->url("/css/ui-customer.css")}}' );
		e.editor.on( 'mode', function( e ){
			if(e.editor.mode == 'wysiwyg'){
				e.editor.document.appendStyleSheet( '{{$this->Html->url("/stylevars/getcss.css")}}' );
				e.editor.document.appendStyleSheet( '{{$this->Html->url("/css/ui-customer.css")}}' );
			}
		});
	});
});

function show135Editor(){
	var url = 'http://www.135editor.com/beautify_editor?callback={{urlencode(Router::url('/pages/editorCallback',true))}}';
	var myEditor = window.open(url,'new_window','height='+(window.screen.availHeight - 60) +',width='+(window.screen.availWidth - 60)+';help=no,resizable=no,status=no,scroll=yes');
	setTimeout(function(){
		myEditor.postMessage(ckeditors['FeedBackName'].getData(),'*');
	},3000);
	
}
function get_135editor_content($html) {
	ckeditors['FeedBackName'].setData($html);
}

</script>
<?php } ?>
</div>
</div>
